export const API = {
  auth: {
    signin: '/auth/signin',
    signup: '/auth/signup'
  },
  user: {
    profile: '/users/profile',
    update: '/users/profile'
  },
  project: {
    list: '/projects',
    create: '/projects',
    detail: (id: number) => `/projects/${id}`,
    update: (id: number) => `/projects/${id}`,
    delete: (id: number) => `/projects/${id}`
  },
  requestGroup: {
    list: (projectId: number) => `/request-groups?projectId=${projectId}`,
    create: '/request-groups',
    update: (id: number) => `/request-groups/${id}`,
    delete: (id: number) => `/request-groups/${id}`,
    simple: (projectId: number) => `/request-groups/simple?projectId=${projectId}`
  },
  requestInterface: {
    list: (groupId: number) => `/request-interfaces?groupId=${groupId}`,
    create: '/request-interfaces',
    detail: (id: number) => `/request-interfaces/${id}`,
    delete: (id: number) => `/request-interfaces/${id}`
  },
  debug: {
    test: '/debug/apitest'
  },
  requestHistory: {
    list: '/request-history',
    group: (id: number) => `/request-history/group/${id}`,
    deleteGroup: (id: number) => `/request-history/group/${id}`
  },
  httpRequest: {
    history: '/request/history'
  }
};

export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
}

export interface Project {
  id: number;
  name: string;
  description: string;
  userId: number;
  createdAt: string;
  updatedAt: string;
}

export interface RequestGroup {
  id: number;
  name: string;
  projectId: number;
  createdAt: string;
  updatedAt: string;
}

export interface RequestInterface {
  id: number;
  name: string;
  groupId: number;
  method: string;
  url: string;
  headers: Record<string, string>;
  params: Record<string, string>;
  body: string;
  createdAt: string;
  updatedAt: string;
} 